using System;
using System.Collections.Generic;

using TnPlus.Entities.Utils;
using TnPlus.Entities.Models;
using TnPlus.DAL;
using TnPlus.Common;

namespace TnPlus.Biz
{
	public class FactorCustomersHistoryService
	{
		/// <summary>
		/// Saves a record to the FactorCustomersHistory table.
		/// </summary>
		public virtual void Insert(FactorCustomersHistoryInfo factorCustomersHistoryInfo)
		{
			try
			{
				new FactorCustomersHistoryDAO().Insert(factorCustomersHistoryInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.FactorCustomersHistory - Insert", ex);
				throw;
			}

		}

		/// <summary>
		/// Saves a record to the FactorCustomersHistory table.
		/// </summary>
		public virtual void Update(FactorCustomersHistoryInfo factorCustomersHistoryInfo)
		{
			try
			{
				new FactorCustomersHistoryDAO().Update(factorCustomersHistoryInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.FactorCustomersHistory - Update", ex);
				throw;
			}

		}

		/// <summary>
		/// Delete a record from the FactorCustomersHistory table.
		/// </summary>
		public virtual void Delete(Guid? idFactorCustomer)
		{
			try
			{
				new FactorCustomersHistoryDAO().Delete(idFactorCustomer);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.FactorCustomersHistory - Delete", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects a single record from the FactorCustomersHistory table.
		/// </summary>
		public virtual FactorCustomersHistoryInfo Select(Guid? idFactorCustomer)
		{
			try
			{
				return new FactorCustomersHistoryDAO().Select(idFactorCustomer);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.FactorCustomersHistory - Select", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects all records from the FactorCustomersHistory table.
		/// </summary>
		public List<FactorCustomersHistoryInfo> SelectAll()
		{
			try
			{
				return new FactorCustomersHistoryDAO().SelectAll();
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.FactorCustomersHistory - SelectAll", ex);
				throw;
			}

		}

	}
}
